#!/bin/bash

# SSD I/O bound performance

if [ $DATABASE == "rethinkdb" ]; then
    ./dbench                                                                 \
        -d "$BENCH_DIR/bench_output/SSD_IO_performance_(canonical_workload)" -H $SERVER_HOSTS     \
        {server}rethinkdb:"--active-data-extents 1 -m 512 $SSD_DRIVES"                          \
        {client}stress[$STRESS_CLIENT]:"-c $CANONICAL_CLIENTS -d $CANONICAL_DURATION"          \
        iostat:1 vmstat:1 rdbstat:1
elif [ $DATABASE == "mysql" ]; then
    ./dbench                                                                 \
        -d "$BENCH_DIR/bench_output/SSD_IO_performance_(canonical_workload)" -H $SERVER_HOSTS     \
        {server}mysql:"$MYSQL_COMMON_FLAGS --innodb_buffer_pool_size=512m $MYSQL_DURABILITY_FLAGS $MYSQL_SSD_FLAGS"  \
        {client}mysqlstress[$STRESS_CLIENT]:"-c $CANONICAL_CLIENTS -d $CANONICAL_DURATION"     \
        iostat:1 vmstat:1
else
    echo "No workload configuration for $DATABASE"
fi
